<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var date = new Date();
    console.log("原:", date);

    // console.log(date.toUTCString()); // 转字符串(世界时)

    // console.log(date.toString());   // 转字符串
    // console.log(date.toDateString());
    // console.log(date.toTimeString());

    console.log(date.toLocaleString());   // 按照本地习惯,将事件转化为对应的格式
    console.log(date.toLocaleDateString());
    console.log(date.toLocaleTimeString());

</script>

</html>